//引入二次封装axios
import request from '@/utils/request'

//一级分类的接口
export function reqC1 (){
  return request({
    url: '/admin/product/getCategory1',
    method: 'get'
  })
}
//二级分类的接口
export function reqC2 (category1Id){
  return request({
    url: `/admin/product/getCategory2/${category1Id}`,
    method: 'get'
  })
}
//三级分类的接口
export function reqC3 (category2Id){
  return request({
    url: `/admin/product/getCategory3/${category2Id}`,
    method: 'get'
  })
}
//获取平台属性的接口
export function reqAttrList ({category1Id,category2Id,category3Id}){
  return request({
    url: `/admin/product/attrInfoList/${category1Id}/${category2Id}/${category3Id}`,
    method: 'get'
  })
}
//添加新的与更新已有的属性接口
export function reqAddOrUpdateAttr (data){
  console.log(data);
  return request({
    url: `/admin/product/saveAttrInfo`,
    method: 'post',
    data,
  })
}
//删除属性值
export function reqDeleteAttr(attrId){
  return request({
    url: `/admin/product/deleteAttr/${attrId}`,
    method: 'delete',
  })
}